<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close" ng-click="close()">
        <span aria-hidden="true">×</span></button>
    <h4 class="modal-title">{{'CONFIG.JOB.MAIL'|translate}}</h4>
</div>
<div class="modal-body">
    <form class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-2 control-label">{{'CONFIG.JOB.TO'|translate}}</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" ng-model="config.to">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{{'CONFIG.JOB.CC'|translate}}</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" ng-model="config.cc">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{{'CONFIG.JOB.BCC'|translate}}</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" ng-model="config.bcc">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{{'CONFIG.JOB.SUBJECT'|translate}}</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" ng-model="config.subject">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{{'CONFIG.JOB.XLSPWD'|translate}}</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" ng-model="config.xlspwd">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2">
                <button type="button" class="btn btn-success" ng-click="addBoard()">{{'CONFIG.JOB.ADD_DASHBOARD'|translate}}</button>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12">
                <table class="table table-hover">
                    <tr>
                        <th>{{'CONFIG.JOB.DASHBOARD'|translate}}</th>
                        <th>{{'CONFIG.JOB.TYPE'|translate}}</th>
                        <th></th>
                    </tr>
                    <tbody dnd-list="config.boards">
                    <tr class="dndPlaceholder sort-highlight">
                        <td>-></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr ng-repeat="board in config.boards" dnd-draggable="board"
                        dnd-moved="config.boards.splice($index, 1)">
                        <td>
                            <ui-select ng-model="board.id">
                                <ui-select-match>
                                    {{$select.selected.name}}
                                </ui-select-match>
                                <ui-select-choices group-by="boardGroup"
                                                   repeat="b.id as b in boardList | filter:{name : $select.search}">
                                    {{b.name}}
                                </ui-select-choices>
                            </ui-select>
                        </td>
                        <td>
                            <select class="form-control" ng-model="board.type"
                                    ng-options="v.type as v.name for v in boardType"></select>
                        </td>
                        <td>
                            <i class="fa fa-trash-o toolbar-icon"  ng-click="config.boards.splice($index, 1)" title="{{'COMMON.DELETE'|translate}}"></i>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default pull-left" data-dismiss="modal" ng-click="close()">
        {{'COMMON.CANCEL'|translate}}
    </button>
    <button type="button" class="btn btn-primary" ng-click="ok()">{{'COMMON.OK'|translate}}</button>
</div>